{extend name="sitehome@style/base"/}
{block name="resources"}
<style>
	.layui-table span{vertical-align: middle;}
</style>
{/block}

{block name="main"}
<div class="nc-table-box">
	<table id="quick_entry_list" lay-filter="quick_entry_list" class="layui-table"></table>
</div>

<script type="text/html" id="addon_info">
	<div class="img-wrap">
		{{# if(d.icon){ }}
		<img src="__ROOT__/{{d.icon}}">
		{{# }else{ }}
		<img src="NIU_APPLET_IMG/icon.png">
		{{# } }}
	</div>
	<span>{{d.title}}</span>
</script>

<script type="text/html" id="operation">
	<a href="javascript:;" class="default" lay-event="promote">推广链接</a>
</script>
{/block}

{block name="script"}
<script>
var table = new Table({
	elem: '#quick_entry_list',
	filter : "quick_entry_list",
	url : '{:addon_url("applet2://sitehome/app/quickEntry")}',
	where : { addon_name : "{$addon_name}" },
	cols: [
		[ {
			width: '40%',
			title: '应用信息',
			templet: '#addon_info',
			unresize : 'true'
		},{
			field : 'name',
			width: '40%',
			title: '关键词',
			unresize : 'true'
		}, {
			title: '操作',
			width: '20%',
			toolbar: '#operation',
			align: 'right',
			unresize : 'true'
		}]
	],
	size: 'lg'
});

table.tool(function (obj) {
	var data = obj.data;
	switch (obj.event) {
		case "promote":
			nc.page_promote(data);
			break;
	}
});
</script>
{/block}